
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit">
    <link rel="shortcut icon" href="/assets/img/favicon.ico"/>
    <!-- Loading Bootstrap -->
    <link href="/assets/css/backend.css?v=1.0.1"
          rel="stylesheet">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="/assets/js/html5shiv.js"></script>
    <script src="/assets/js/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript">
        var require = {
            config: {"app_debug":"","site":{"cdnurl":"","version":"1.0.1","timezone":"Asia\/Shanghai","languages":{"backend":"zh-cn","frontend":"zh-cn"}},"upload":{"cdnurl":"","uploadurl":"ajax\/upload","bucket":"local","maxsize":"10mb","mimetype":"jpg,png,gif,jpeg,bmp,webp","multipart":[],"multiple":false},"modulename":"admin","controllername":"small.goods","actionname":"add","jsname":"backend\/small\/goods","moduleurl":"\/admin","language":"zh-cn","fastadmin":{"usercenter":true,"login_captcha":true,"login_failure_retry":true,"login_unique":false,"login_background":"\/assets\/img\/loginbg.jpg","multiplenav":false,"checkupdate":false,"api_cross":false,"version":"2.0.2","api_url":"https:\/\/api.iuok.cn"},"referer":null}    };
    </script>
    <style>
        .form-horizontal .form-group{
            margin-left: 0 !important;
            margin-right: 0 !important;
        }
        .header_title{
            width: 100%;
            text-align: center;
            margin-top:10px;
            font-size: 18px;
        }
        .fromtitle{
            width:100%;
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 10px;
        }
        .form_input{
            width: 200px;
            border: none;
            height:25px;
            text-indent: 6px;
            border-bottom: 1px solid #111111;
            background: #fff;
        }
        .form_input1{
            width: 150px;
        }
        .span1{
            vertical-align: text-bottom;
            margin-left: 5px;
        }
        .submitdiv{
            width: 100%;
            text-align: center;
            margin-bottom: 10px;
        }
        .submitdiv span{
            display: inline-block;
            background: darkblue;
            color: #fff;
            padding: 5px 20px;
            cursor: pointer;
            margin: 15px 0;
        }
        #win{
            position: fixed;
            top:50%;
            left: 50%;
            z-index: 99;
            width: 200px;
            line-height: 50px;
            margin: -30px 0 0 -100px;
            font-size: 15px;
            color: #fff;
            background: #242333;
            text-align: center;
            opacity: 0;
            transition: opacity 500ms 10s ease;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            -ms-border-radius: 5px;
            -o-border-radius: 5px;
            border-right: 5px;
        }
        #win.win_active{
            opacity: .72;
        }
        .form-group p{
            margin-left:5% !important;
        }
    </style>
</head>
<body class="inside-header inside-aside is-dialog">
<div id="main" role="main">

    <div class="tab-content tab-addtabs">
        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div id="win" class="win_active" ></div>
                    <div class="header_title">魏医堂问诊单</div>
                    <div class="content">
                        <form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
                            <div class="fromtitle">基本信息栏</div>
                            <div class="form-group">
                                <p>
                                    <span>姓名：</span><input type="text" class="form_input" id="username" name="row[username]" value="" >
                                </p>
                                <p>
                                    <span style="vertical-align: text-bottom;">性别：</span>
                                    <input type="radio" name="sex" value="1"/> <span class="span1">男</span>
                                    <input type="radio" name="sex" value="2"/> <span class="span1">女</span>
                                </p>
                                <p><span>年龄：</span><input type="number" class="form_input" id="age"  value=""></p>
                                <p><span>家庭住址：</span><input type="text" id="address" class="form_input"  value=""></p>
                                <p><span>联系电话：</span><input type="text" id="mobile" class="form_input form_input1" value="" data-rule="required;mobile"></p>
                            </div>
                            <div class="fromtitle">初步问诊记录栏</div>
                            <div class="form-group">
                                <p class="form-groupp">1.喝水情况？</p>
                                <p><input type="radio" name="water" value="A"/> <span class="span1">A 喜冷饮</span></p>
                                <p><input type="radio" name="water" value="B"/> <span class="span1">B 喜热饮</span></p>
                                <p><input type="radio" name="water" value="C"/> <span class="span1">C 口渴但不想喝水</span> </p>
                                <p><input type="radio" name="water" value="D"/> <span class="span1">D 口渴想大量喝水</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">2.胃口？（可多选）</p>
                                <p><input type="checkbox" name="appetite" value="A"/> <span class="span1">A 较差</span></p>
                                <p><input type="checkbox" name="appetite" value="B"/> <span class="span1">B 吃得多但容易饿</span></p>
                                <p><input type="checkbox" name="appetite" value="C"/> <span class="span1">C 想吃但吃不下</span></p>
                                <p><input type="checkbox" name="appetite" value="D"/> <span class="span1">D 伴有反酸、打嗝、胀气</span></p>
                                <p><input type="checkbox" name="appetite" value="E"/> <span class="span1">E 胃有烧心感</span></p>
                                <p><input type="checkbox" name="appetite" value="F"/> <span class="span1">F 伴有恶心、呕吐</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">3.大便情况？</p>
                                <p><input type="radio" name="stool" value="A"/> <span class="span1">A 长期便秘</span></p>
                                <p><input type="radio" name="stool" value="B"/> <span class="span1">B 长期不成形</span></p>
                                <p><input type="radio" name="stool" value="C"/> <span class="span1">C 受凉易腹泻</span> </p>
                                <p><input type="radio" name="stool" value="D"/> <span class="span1">D 大便先干后稀</span></p>
                                <p><input type="radio" name="stool" value="E"/> <span class="span1">E 大便不爽粘马桶（上厕所不痛快）</span></p>
                                <p><input type="radio" name="stool" value="F"/> <span class="span1">F 大便伴有灼热感</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">4.大便颜色？</p>
                                <p><input type="radio" name="stoolcolor" value="A"/> <span class="span1">A 黑</span></p>
                                <p><input type="radio" name="stoolcolor" value="B"/> <span class="span1">B 灰白</span></p>
                                <p><input type="radio" name="stoolcolor" value="C"/> <span class="span1">C 绿</span> </p>
                                <p><input type="radio" name="stoolcolor" value="D"/> <span class="span1">D 便血</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">5.小便情况？（可多选）</p>
                                <p><input type="checkbox" name="urinate" value="A"/> <span class="span1">A 夜尿次数多次</span></p>
                                <p><input type="checkbox" name="urinate" value="B"/> <span class="span1">B 尿频、尿急、尿不尽</span></p>
                                <p><input type="checkbox" name="urinate" value="C"/> <span class="span1">C 小便时有涩痛感</span></p>
                                <p><input type="checkbox" name="urinate" value="D"/> <span class="span1">D 尿血</span></p>
                                <p><input type="checkbox" name="urinate" value="E"/> <span class="span1">E 小便带有泡沫</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">6.小便颜色？ </p>
                                <p><input type="radio" name="urinatecolor" value="A"/> <span class="span1">A 黄（浓茶色）</span></p>
                                <p><input type="radio" name="urinatecolor" value="B"/> <span class="span1">B 红</span></p>
                                <p><input type="radio" name="urinatecolor" value="C"/> <span class="span1">C 淡黄</span> </p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">7.睡眠情况？（可多选）</p>
                                <p><input type="checkbox" name="sleepcondition" value="A"/> <span class="span1">A 入睡困难</span></p>
                                <p><input type="checkbox" name="sleepcondition" value="B"/> <span class="span1">B 睡眠浅、易醒</span></p>
                                <p><input type="checkbox" name="sleepcondition" value="C"/> <span class="span1">C 睡眠时间短、多梦</span></p>
                                <p><input type="checkbox" name="sleepcondition" value="D"/> <span class="span1">D 睡眠不解乏</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">8.睡眠伴随症状？ </p>
                                <p><input type="radio" name="sleepsymptoms" value="A"/> <span class="span1">A 白天犯困</span></p>
                                <p><input type="radio" name="sleepsymptoms" value="B"/> <span class="span1">B 饭后犯困</span></p>
                                <p><input type="radio" name="sleepsymptoms" value="C"/> <span class="span1">C 嗜睡</span> </p>
                                <p><input type="radio" name="sleepsymptoms" value="D"/> <span class="span1">D 睡觉流口水</span></p>
                                <p><input type="radio" name="sleepsymptoms" value="E"/> <span class="span1">E 睡觉打呼噜</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">9.情绪状况？（可多选）</p>
                                <p><input type="checkbox" name="mood" value="A"/> <span class="span1">A 容易生气</span></p>
                                <p><input type="checkbox" name="mood" value="B"/> <span class="span1">B 容易忘事</span></p>
                                <p><input type="checkbox" name="mood" value="C"/> <span class="span1">C 容易焦虑、爱叹气</span></p>
                                <p><input type="checkbox" name="mood" value="D"/> <span class="span1">D 易受惊吓</span></p>
                                <p><input type="checkbox" name="mood" value="E"/> <span class="span1">E 思虑较多</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">10.身体感觉？（可多选）</p>
                                <p><input type="checkbox" name="bodyg" value="A"/> <span class="span1">A 怕冷或手脚偏冷</span></p>
                                <p><input type="checkbox" name="bodyg" value="B"/> <span class="span1">B 怕热</span></p>
                                <p><input type="checkbox" name="bodyg" value="C"/> <span class="span1">C 怕风</span></p>
                                <p><input type="checkbox" name="bodyg" value="D"/> <span class="span1">D 忽冷忽热</span></p>
                                <p><input type="checkbox" name="bodyg" value="E"/> <span class="span1">E 手脚心热烫</span></p>
                                <p><input type="checkbox" name="bodyg" value="F"/> <span class="span1">F 上身热下身冷</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">11.出汗？（身上有潮润感也算出汗）（可多选）</p>
                                <p><input type="checkbox" name="sweating" value="A"/> <span class="span1">A 稍活动就大汗淋漓</span></p>
                                <p><input type="checkbox" name="sweating" value="B"/> <span class="span1">B 平时出汗</span></p>
                                <p><input type="checkbox" name="sweating" value="C"/> <span class="span1">C 基本不出汗</span></p>
                                <p><input type="checkbox" name="sweating" value="D"/> <span class="span1">D 手足心出汗明显</span></p>
                                <p><input type="checkbox" name="sweating" value="E"/> <span class="span1">E 睡觉时容易出汗</span></p>
                                <p><input type="checkbox" name="sweating" value="F"/> <span class="span1">F 仅头部出汗</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">12.头咽部是否有以下情况？ </p>
                                <p><input type="radio" name="headpharynx" value="A"/> <span class="span1">A 头痛</span></p>
                                <p><input type="radio" name="headpharynx" value="B"/> <span class="span1">B 头晕</span></p>
                                <p><input type="radio" name="headpharynx" value="C"/> <span class="span1">C 咽干、咽痒</span> </p>
                                <p><input type="radio" name="headpharynx" value="D"/> <span class="span1">D 咽部有异物感</span></p>
                                <p><input type="radio" name="headpharynx" value="E"/> <span class="span1">E 鼻塞、易流清涕</span></p>
                                <p><input type="radio" name="headpharynx" value="F"/> <span class="span1">F 眼睛干涩、视物模糊</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">13.咳嗽和痰？ </p>
                                <p><input type="radio" name="cough" value="A"/> <span class="span1">A 咳嗽</span></p>
                                <p><input type="radio" name="cough" value="B"/> <span class="span1">B 伴有气喘</span></p>
                                <p><input type="radio" name="cough" value="C"/> <span class="span1">C 伴有痰白量多</span> </p>
                                <p><input type="radio" name="cough" value="D"/> <span class="span1">D 伴有黄痰</span></p>
                                <p><input type="radio" name="cough" value="E"/> <span class="span1">E 痰多泡沫状</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">14.胸腹部有没有以下情况？ </p>
                                <p><input type="radio" name="abdomen" value="A"/> <span class="span1">A 颈项后背部拘紧</span></p>
                                <p><input type="radio" name="abdomen" value="B"/> <span class="span1">B 胸部胀满</span></p>
                                <p><input type="radio" name="abdomen" value="C"/> <span class="span1">C 心慌、胸闷、气短</span> </p>
                                <p><input type="radio" name="abdomen" value="D"/> <span class="span1">D 下腹部隐隐作痛</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">15.身体是否伴有以下情况？ </p>
                                <p><input type="radio" name="health" value="A"/> <span class="span1">A 身体觉得困重、乏力</span></p>
                                <p><input type="radio" name="health" value="B"/> <span class="span1">B 四肢烦疼</span></p>
                                <p><input type="radio" name="health" value="C"/> <span class="span1">C 睡觉时四肢不自觉抽动 </span> </p>
                                <p><input type="radio" name="health" value="D"/> <span class="span1">D 腰酸、腰痛</span></p>
                                <p><input type="radio" name="health" value="E"/> <span class="span1">E 脚后跟疼痛</span></p>
                                <p>妇科专用（已经绝经者无需填写）</p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">16.是否处于特殊阶段？ </p>
                                <p><input type="radio" name="health1" value="A"/> <span class="span1">A 备孕中</span></p>
                                <p><input type="radio" name="health1" value="B"/> <span class="span1">B 孕期</span></p>
                                <p><input type="radio" name="health1" value="C"/> <span class="span1">C 哺乳期</span> </p>
                                <p><input type="radio" name="health1" value="D"/> <span class="span1">D 经期 </span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">17.月经情况？ </p>
                                <p><input type="radio" name="health2" value="A"/> <span class="span1">A 月经提前</span></p>
                                <p><input type="radio" name="health2" value="B"/> <span class="span1">B 月经推后</span></p>
                                <p><input type="radio" name="health2" value="C"/> <span class="span1">C 月经先后不定期</span> </p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">18.经期是否伴随以下症状？（可多选）</p>
                                <p><input type="checkbox" name="health3" value="A"/> <span class="span1">A 伴有痛经</span></p>
                                <p><input type="checkbox" name="health3" value="B"/> <span class="span1">B 经色暗、伴有血块</span></p>
                                <p><input type="checkbox" name="health3" value="C"/> <span class="span1">C 经量多</span></p>
                                <p><input type="checkbox" name="health3" value="D"/> <span class="span1">D 经量少</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">19.带下情况？ </p>
                                <p><input type="radio" name="health4" value="A"/> <span class="span1">A 带下色白量多</span></p>
                                <p><input type="radio" name="health4" value="B"/> <span class="span1">B 带下呈豆腐渣样</span></p>
                                <p><input type="radio" name="health4" value="C"/> <span class="span1">C 带下色黄</span> </p>
                                <p><input type="radio" name="health4" value="D"/> <span class="span1">D 带下伴有异味</span></p>
                            </div>
                            <div class="form-group">
                                <p class="form-groupp">20.经期感觉？（可多选）</p>
                                <p><input type="checkbox" name="health5" value="A"/> <span class="span1">A 乳房胀痛</span></p>
                                <p><input type="checkbox" name="health5" value="B"/> <span class="span1">B 腰酸、腰困</span></p>
                                <p><input type="checkbox" name="health5" value="C"/> <span class="span1">C 小腹坠胀</span></p>
                                <p><input type="checkbox" name="health5" value="D"/> <span class="span1">D 头痛</span></p>
                            </div>
                            <div class="fromtitle">主诉：（目前最不舒服的症状）</div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2">请输入其他症状（选填）:</label>
                                <textarea id="c-content" class="form-control " rows="5"  cols="50"></textarea>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group">
                                        <input id="c-inimages" style="display: none;" data-rule="" class="form-control" size="50" name="details[images_url]" type="text" value="">
                                        <div class="input-group-addon no-border no-padding">
                                            <span>
                                                <button type="button" id="plupload-inimages" data-url="ajax/inquiryupload"  class="btn btn-danger plupload" data-input-id="c-inimages" data-oss-id="alyoss"
                                                        data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-inimages">
                                                    <i class="fa fa-upload"></i> 上传图片
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                    <span class="msg-box n-right" for="c-inimages"></span>
                                    <ul class="row list-inline plupload-preview" id="p-inimages"></ul>
                                </div>
                            </div>
                            <div class="submitdiv">
                                <span onclick="wenzhen()">提交</span>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/assets/js/require.js"  data-main="/assets/js/require-backend.js?v=1.0.1"></script>
</body>
</html>
<script type="text/javascript">


    function showwin(msg) {
        var win = document.getElementById('win'),t;
        win.innerText = msg;
        t=setTimeout(function(){
            win.innerText='';
            clearTimeout(t)
        },3000)

    }



    function wenzhen(){
        var username = $("#username").val();
        var sex = $('input[name="sex"]:checked').val() ? $('input[name="sex"]:checked').val():0 ;
        var age = $("#age").val();
        var address = $("#address").val();
        var mobile = $("#mobile").val();
        if(username == ''){
            $("#username").focus();
            return;
        }
        if(mobile == ''){
            $("#mobile").focus();
            return;
        }
        var water = $('input[name="water"]:checked').val() ? $('input[name="water"]:checked').val() : 'A'; //1
        var appetite = new Array();
        //循环所有选中的值
        $('input[name="appetite"]:checked').each(function(index, element) {
            //追加到数组中
            appetite.push($(this).val());
        });
        var appetitestr = appetite.join(','); //2
        var stool = $('input[name="stool"]:checked').val() ? $('input[name="stool"]:checked').val() : 'A'; //3
        var stoolcolor = $('input[name="stoolcolor"]:checked').val() ? $('input[name="stoolcolor"]:checked').val() : 'A'; //4
        var urinatearry = new Array();
        $('input[name="urinate"]:checked').each(function(index, element) {
            //追加到数组中
            urinatearry.push($(this).val());
        });
        var urinatestr = urinatearry.join(',');//5
        var urinatecolor = $('input[name="urinatecolor"]:checked').val() ? $('input[name="urinatecolor"]:checked').val() : 'A';//6
        var sleepconditionarry = new Array();
        $('input[name="sleepcondition"]:checked').each(function(index, element) {
            //追加到数组中
            sleepconditionarry.push($(this).val());
        });
        var sleepconditionstr = sleepconditionarry.join(',');//7
        var sleepsymptoms = $('input[name="sleepsymptoms"]:checked').val() ? $('input[name="sleepsymptoms"]:checked').val() : 'A';//8
        var moodarry = new Array();
        $('input[name="mood"]:checked').each(function(index, element) {
            //追加到数组中
            moodarry.push($(this).val());
        });
        var moodstr = moodarry.join(',');//9
        var bodygarry = new Array();
        $('input[name="bodyg"]:checked').each(function(index, element) {
            //追加到数组中
            bodygarry.push($(this).val());
        });
        var bodygstr = bodygarry.join(',');//10
        var sweatingarry = new Array();
        $('input[name="sweating"]:checked').each(function(index, element) {
            //追加到数组中
            sweatingarry.push($(this).val());
        });
        var sweatingstr = sweatingarry.join(',');//11
        var headpharynx = $('input[name="headpharynx"]:checked').val() ? $('input[name="headpharynx"]:checked').val() :'A';//12
        var cough = $('input[name="cough"]:checked').val() ? $('input[name="cough"]:checked').val() : 'A';//13
        var abdomen = $('input[name="abdomen"]:checked').val() ? $('input[name="abdomen"]:checked').val() : 'A';//14
        var health = $('input[name="health"]:checked').val() ? $('input[name="health"]:checked').val() : 'A';//15
        var health1 = $('input[name="health1"]:checked').val() ? $('input[name="health1"]:checked').val() : 'A';//16
        var health2 = $('input[name="health2"]:checked').val() ? $('input[name="health2"]:checked').val() : 'A';//17

        var health3arry = new Array();
        $('input[name="health3"]:checked').each(function(index, element) {
            //追加到数组中
            health3arry.push($(this).val());
        });
        var health3str = health3arry.join(',');//18
        var health4 = $('input[name="health4"]:checked').val() ? $('input[name="health4"]:checked').val() : 'A';//19
        var health5arry = new Array();
        $('input[name="health5"]:checked').each(function(index, element) {
            //追加到数组中
            health5arry.push($(this).val());
        });
        var health5str = health5arry.join(',');//20
        var content = $("#c-content").val()
        var inimages = $("#c-inimages").val()
        $.ajax({
            url:"{:url('Inquiry/save')}",
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            data: {
                username:username,sex:sex,age:age,address:address,mobile:mobile,water:water,appetite:appetitestr,
                stool:stool,stoolcolor:stoolcolor,urinate:urinatestr,urinatecolor:urinatecolor,
                sleepcondition:sleepconditionstr,sleepsymptoms:sleepsymptoms,mood:moodstr,bodyg:bodygstr,
                sweating:sweatingstr,headpharynx:headpharynx,cough:cough,abdomen:abdomen,
                health:health,health1:health1,health2:health2,health3:health3str,
                health4:health4,health5:health5str,content:content,inimages:inimages
            },
            success: function (result) {
                if(result.status == 'ok'){
                    // showwin('保存成功')
                    window.location.href="{:url('Inquiry/details')}"+"?inquiryid="+result.msg.inquiryid+"&inquiryinfoid="+result.msg.inquiryinfoid
                }
            },
            error : function() {
                alert("异常！");
            }
        })
    }
</script>